<!--
 * Copyright 2019 Hiro Hashimukai on the ia-cloud project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 -->

<script type="text/html" data-template-name="PLC-sim">
    <div class="form-row">
        <label style="margin-right: 10px;" for="node-input-interval"><span data-i18n="editor.interval"></span></label>
        <input type="number" id="node-input-interval" min="0" step="1"
            value="1" style="display: inline-block; width: auto;">
    </div>
    <hr>
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i>
            <span data-i18n="editor.name"></span></label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]editor.name">
    </div>
</script>

<script type="text/javascript">


    // NodeをNode-REDへ登録
    RED.nodes.registerType('PLC-sim', {

        category: 'iaCloud devices',
        color: "rgb(231, 180, 100)",
        defaults: {
            interval: {value: 1, required: true},
            name: {value:""}
        },

        inputs: 0,
        outputs: 0,
        icon: "ia-cloud.png",  //アイコンはTBD

        paletteLabel: function() {
            return this._("editor.paletteLabel") || "modbusSim";
        },
        label: function () {
            return this.name || this._("editor.paletteLabel");
        },
        labelStyle: function () {
            return this.name?"ode_label_italic":"";
        },
    
    });

</script>
